package router

import (
	"car-order-sys/handler"
	"net/http"

	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	r.POST("/login", handler.Login)
	r.POST("/role", handler.RoleNodeAdd)
	r.POST("/user", handler.UserRoleAdd)
	r.GET("/roleList", handler.RoleList)
	r.GET("/userList", handler.UserList)
	r.POST("/car", handler.CarAdd)
	r.POST("order", handler.OrderAdd)
	r.GET("/list", handler.List)
	r.GET("/detail", handler.Detail)
	return r
}
